home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 February / chip_02_2005_cd1.iso / Foto tools_ / VCW VicMan's Photo Editor 7.8_ / phedinst.exe / {app} / tdemo.js < prev    next >
Text File  |  2001-09-18  |  1KB  |  49 lines

  1. function isDemoOk()
  2. {
  3.      IsOk=true;
  4.      bver=Math.round(parseFloat(navigator.appVersion) * 1000);
  5.      if (navigator.appName.substring(0,8) == "Netscape")
  6.      {
  7.          if ((bver<5000) && (navigator.appVersion.indexOf("Mac")> 0))
  8.              IsOk=false;
  9.          else if (bver<4060)
  10.              IsOk=false;
  11.      }
  12.      if (navigator.appName.substring(0,9) == "Microsoft")
  13.      {
  14.          if(bver<4000)
  15.              IsOk=false;
  16.      }
  17.      plugins=navigator.plugins;
  18.      if (plugins!=null && IsOk==false)
  19.      {
  20.          for(i=0;i!=plugins.length;i++)
  21.               if((plugins[i].name.indexOf("1.0")<0) && (plugins[i].name.indexOf("Java Plug-in")>=0))
  22.                   IsOk=true;
  23.      }
  24.      return IsOk;
  25. }
  26.  
  27. function openDemo(htmlFile,htmlWidth,htmlHeight)
  28. {
  29. var bua = navigator.userAgent;
  30.  
  31.      s = 'resizable=0,toolbar=0,menubar=0,scrollbars=0,status=0,location=0,directory=0,width=350,height=200';
  32.      if(!isDemoOk())
  33.      {
  34.           open("http://www.turbodemo.com/error.html",'',s);
  35.      }
  36.      else
  37.      {
  38.  
  39.      if (bua.indexOf("Opera")!= -1) 
  40.       {
  41.           window.open(htmlFile+".htm",'','width='+htmlWidth+',height='+htmlHeight+',top=10,left=10');
  42.       }
  43.      else
  44.       {
  45.           window.open(htmlFile+".htm",'','width='+htmlWidth+',height='+htmlHeight+',top=10,left=10');
  46.       }
  47.  
  48.      }
  49. }